<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_CreateTable_UserInfo extends CI_Migration
{
    public function up()
    {
        $this->dbforge->add_field('id');
        $this->dbforge->add_field(array(
            'real_name'   => array('type' => 'VARCHAR', 'constraint' => '20', 'null' => TRUE,),
            'sex'         => array('type' => 'TINYINT', 'constraint' => '1', 'null' => TRUE,),
            'city'        => array('type' => 'VARCHAR', 'constraint' => '30', 'null' => TRUE,),
            'phone'       => array('type' => 'VARCHAR', 'constraint' => '20', 'null' => TRUE,),
            'qq'          => array('type' => 'VARCHAR', 'constraint' => '20', 'null' => TRUE,),
            'profile'     => array('type' => 'TEXT', 'null' => TRUE,),
            'avatar_hash' => array('type' => 'VARCHAR', 'constraint' => '100', 'null' => TRUE,),
            'user_id'     => array('type' => 'INT', 'constraint' => '9'),
        ));
        $this->dbforge->create_table('user_info');
    }

    public function down()
    {
        $this->dbforge->drop_table('user_info');
    }
} 